import com.mera.tektronix.csviewer.domain.*

class BootStrap {
	
	def grailsApplication
	
	def init = { servletContext ->		
		new Company(name: "Mera", email: "mera@mera.ru", address:"Nizhny Novgorod, Delovaya 13", phone: "278-88-88")
		.addToDepartments(new Department(name: "Dep_1", email: "dep_1@mera.ru", phone: "278-88-88#0001")
			.addToProjects(new Project(name: "Prj_1", email: "prj_1@mera.ru", phone: "278-88-88#0011")
				.addToEmployees(new Employee(name:"Bart", birthDate: new Date("1989/1/9"), email: "bart@mera.ru", hiredDate:new Date("2012/1/1"), position:"Position", phone:"278-88-88#0001"))
				.addToEmployees(new Employee(name:"Homer", birthDate: new Date("1989/1/9"), email: "homer@mera.ru", hiredDate:new Date("2012/1/1"), position:"Position", phone:"278-88-88#0002"))
				.addToEmployees(new Employee(name:"Spanch", birthDate: new Date("1989/1/9"), email: "spanch@mera.ru", hiredDate:new Date("2012/1/1"), position:"Position", phone:"278-88-88#0003"))))
		.addToDepartments(new Department(name: "Dep_2", email: "dep_2@mera.ru", phone: "278-88-88#0002")
			.addToProjects(new Project(name: "Prj_1", email: "prj_1@mera.ru", phone: "278-88-88#0021")
				.addToEmployees(new Employee(name:"Optimus", birthDate: new Date("1989/1/9"), email: "optimus@mera.ru", hiredDate:new Date("2012/1/1"), position:"Position", phone:"278-88-88#0004"))
				.addToEmployees(new Employee(name:"Hulk", birthDate: new Date("1989/1/9"), email: "hulk@mera.ru", hiredDate:new Date("2012/1/1"), position:"Position", phone:"278-88-88#0005"))
				.addToEmployees(new Employee(name:"Batman", birthDate: new Date("1989/1/9"), email: "batman@mera.ru", hiredDate:new Date("2012/1/1"), position:"Position", phone:"278-88-88#0006"))))
		.save()
	}
    def destroy = {
    }
}
